<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>location对象</title>
		<script>
			function showLoc(){
				console.log(history.length);
				console.log(history[0]);
				alert(window.location);
				alert(window.location.host);
				alert(window.location.hostname);
				alert(window.location.href);
			}
			function goBaidu(){ 
				//window.location.href="../day7/roll.html";
				window.location.replace("../day7/roll.html");
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="window.location.reload()">刷新</button>
		<button type="button" onclick="showLoc()">获得location信息</button>
		<button onclick="goBaidu()" type="button">去百度</button>
	</body>
</html>